home *** CD-ROM | disk | FTP | other *** search
- /*
- File: MailGateway.h
-
- Copyright: © 1991-1994 by Apple Computer, Inc.
- All rights reserved.
-
- Part of the AOCE Sample SMSAM Package. Consult the license
- which came with this software for your specific legal rights.
-
- */
-
-
-
- #ifndef __MAILGATEWAY__
- #define __MAILGATEWAY__
-
- #ifndef __BLJSTANDARDINCLUDES__
- #include "BLJStandardIncludes.h"
- #endif
-
- #ifndef __DIRECTOBJECT__
- #include "DirectObject.h"
- #endif
-
- #ifndef __PASCALSTRING__
- #include "PascalString.h"
- #endif
-
- /***********************************|****************************************/
-
- class THalfGateway;
- class ATupleKey;
- class ADataItem;
- class TLetter;
-
- /***********************************|****************************************/
-
- class TMailGateway : public TDirectObject
- {
- public: virtual ~TMailGateway();
-
- // This sets the gateway up and gets it ready to start running.
- virtual Boolean Setup(short vRefNum, long dirID, const char* serverName) = 0; // this will load the named configuration
-
- // This 'starts' the gateway off and running. First, it will initiate the Recovery phase
- // for each half gateway. When this is completed by all half gateways, then it will call
- // the Run() for each half gateway.
- virtual Boolean Run(void) = 0;
-
- // This prepares the gateway to shut down. The gateway won't be fully shut down until the
- // ReadyToShutDown() returns true.
- virtual Boolean PrepareToShutDown(long inHowManySeconds) = 0;
- virtual Boolean ReadyToShutDown(void) = 0;
- virtual Boolean CancelGatewayShutdown (void) = 0;
- virtual Boolean ShutDown(void) = 0;
-
- // These deal with sending a letter from the local system to the remote system.
- virtual Boolean ReceiveLetter (TLetter *letter, THalfGateway *originatorHalfGateway) = 0;
- virtual Boolean RereceiveLetter(TLetter* letter, THalfGateway* originatorHalfGateway) = 0;
-
- //
- // CONFIGURATION / SETUP METHODS
- // =============================
- //
- virtual Boolean GetConfigItem(const ATupleKey& key, ADataItem& ) = 0;
- virtual Boolean SetConfigItem(const ATupleKey& key, const ADataItem& ) = 0;
- virtual Boolean DeleteConfigItem(const ATupleKey& key) = 0;
- virtual Boolean GetNthConfigKey(unsigned long index, ATupleKey& key) = 0;
-
- //
- // STATUS REPORTING / ERROR REPORTING OPTIONS
- // ==========================================
- //
- virtual Boolean GetStatusItem(const ATupleKey& key, ADataItem&) = 0;
- virtual Boolean SetStatusItem(const ATupleKey& key, const ADataItem& ) = 0;
-
- virtual Boolean GetStatusStr ( CStr255 statusStr ) const;
- virtual Boolean SetStatusStr ( CStr255 statusStr );
-
-
- virtual Boolean HandleMonitoringEvent ( const ADataItem& event );
-
- //
- // MISC METHODS
- // ============
- //
-
- virtual ostream& operator >> ( ostream& ) const;
-
-
- // Class constructor is protected because this is an abstract base class.
- protected: TMailGateway();
-
- };
-
- /***********************************|****************************************/
-
- #endif // __MAILGATEWAY__
-